#!/usr/bin/env python3
# -*- coding: utf-8 -*-


import xlrd

file='D:\python_work\工作表.xlsx'

data=xlrd.open_workbook(file)

table=data.sheet_by_index(0)

nrows=table.nrows
print("行数： %s " % nrows)
colnames =  table.row_values(0)
list=[]

for rownum in range(1,nrows):
    row=table.row_values(rownum)
    if row:
        app={}
        for i in range(len(colnames)):
            app[colnames[i]]=row[i]
        list.append(app)

for row in list:
    print(row)
